package com.haizhi.crm.sys.configure.dao;

import com.haizhi.crm.sys.configure.model.ModuleSettingDo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by caochao on 2018/05/31.
 */
@Repository
public interface ModuleSettingDao extends JpaRepository<ModuleSettingDo, Long> {

    @Query(value = "select m from ModuleSettingDo m where moduleId = ?1" )
    List<ModuleSettingDo> findByModuleId(Long moduleId);

    @Query(value = "select m from ModuleSettingDo m where moduleId = ?1 and defaultChecked = ?2" )
    List<ModuleSettingDo> findByModuleIdAndDefaultChecked(Long moduleId, String defaultChecked);
}
